package com.zqxq.lottery.mapper.jczq;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.zqxq.lottery.entity.bo.jczq.MatchApiBO;
import com.zqxq.lottery.entity.po.jczq.JczqMatchPO;
import com.zqxq.lottery.entity.vo.jczq.HomeMatchVO;
import com.zqxq.lottery.entity.vo.jczq.LeagueApiVO;
import com.zqxq.lottery.entity.vo.jczq.MatchApiVO;
import com.zqxq.lottery.entity.vo.jczq.MatchVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component(value = "jczqMatchMapper")
public interface JczqMatchMapper extends BaseMapper<JczqMatchPO> {

    List<HomeMatchVO> queryHomeHotMatchList();

    List<HomeMatchVO> queryHomeHotMatchList2();

    Integer searchPeopleCount(String code);

    //select  league,league_id leagueId,count(league) matchNum from jczq_match where close_time>now() and date(DATE_ADD(curdate(),INTERVAL 2 day))>close_time group by league,league_id
    List<LeagueApiVO> queryHotLeagueList();

    @Select("select left(`code`,9) c from jczq_match where close_time>NOW() and match_type=#{matchType} and `status`=0 group by c order by c")
    List<String> getHotMatchCode(Integer matchType);
    //APP API
    List<MatchVO> getHotMatchList(MatchApiBO search);

    List<JczqMatchPO> getLastMatch(@Param("type") Integer type);

    List<JczqMatchPO> getPassMatch();
}
